<%@ page language="java" import="java.util.*,cat.beans.*,cat.dao.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML>
<html>
  <head>
    <title>分类维护</title>
     
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/maintable.css" ></link>
	<style type="text/css">
		.catenametd{
			width:140px;
		}	
		.secondtd{
			width:23%;
		}

	</style>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.8.0.js"></script>

  </head>
  
  <body>
    <div class ="div_title">
			<div class="div_titlename"> <img src="images/san_jiao.gif" ><span>商品维护  分类管理</span></div>
	</div>
  	<form  method="post">
	   	<table class="main_table">
	  	 	<tr>
	   			<th colspan="2">一级分类</th><th colspan="2">二级分类</th>
	   		</tr>
	   		<c:forEach var="cate" items="${cateList }">
	   			<tr>
	   				<td class="catenametd">
	   					<a style="color:#295568" title="${cate.des }">${cate.cateName }</a>
	   				</td>
	   				<td class="secondtd">
	   					 <a href="${pageContext.request.contextPath}/goods/bigcate_edit.jsp?id=${cate.id}">修改</a> | 
	   					 <a onclick="return confirm('确定要删除此分类吗?')" href="${pageContext.request.contextPath }/CateServlet.do?flag=delbigcate&id=${cate.id}">删除</a>
	   				</td>

	   				<td class="catenametd">	
	   					<c:forEach  var="cate_sub" items="${cate.subCateList }">
	   							<a style="color:#295568" title="${cate_sub.des }">${cate_sub.cateName }</a> <br>		
	   					</c:forEach>
	   				</td>
	   				<td>
	   					<c:forEach  var="cate_sub" items="${cate.subCateList }">
	   							<a href="${pageContext.request.contextPath}/goods/smallcate_edit.jsp?id=${cate_sub.id}"> 修改 </a> |
	   						    <a onclick="return confirm('确定要删除此分类吗?')" href="${pageContext.request.contextPath }/CateServlet.do?flag=delsmallcate&id=${cate_sub.id}"> 删除 </a><br>
	   					</c:forEach>
	   				</td>
	   			</tr>
	   		</c:forEach>	  		
	   	</table>

   	</form>
	
   	
   	<script>
   		var msg="${msg}";
   		if(msg!=""){
   			alert(msg);
   		}
   	</script>
   	
  </body>
</html>
